package serviceImpl;

import dao.StudentMapper;
import entity.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import service.StudentService;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper studentMapper;
    @Override
    public Student getStudentByStuID(String stuID) {
        return studentMapper.getStudentByStuID(stuID);
    }

    @Override
    public Student getStudentByStuIDAndPassword(String stuID, String password) {
        return studentMapper.getStudentByStuIDAndPassword(stuID,password);
    }

    @Override
    public List<Student> getAllStudent() {
        return studentMapper.getAllStudent();
    }

    @Override
    public boolean updateStudent(Student student) {
        return studentMapper.updateStudent(student);
    }

    @Override
    public boolean deleteStudent(String StuID) {
        return studentMapper.deleteStudent(StuID);
    }

    @Override
    public boolean addStudent(Student student) {
        return studentMapper.addStudent(student);
    }

    @Override
    public List<Student> getStudentByStuIDORStuName(String stuID, String stuName) {
        return studentMapper.getStudentByStuIDORStuName(stuID,stuName);
    }
}
